<?php
/*
 * This file is part of SoftSite.
 *
 * (c) 2012 Steve Tredinnick
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 *
 * @package softsite
 * @author  Steve Tredinnick <steve.tredinnick@gmail.com>
 */

namespace Lib\Forms\Elements;

use Lib\Forms\BaseElement;

if(!defined('IN_APP'))
{
    Die("Direct Access to PHP Scripts is not permitted");
}


class InputElement extends BaseElement
{
    protected $accept;
    protected $alt;
    protected $Attribute;
    protected $autocomplete;
    protected $autofocus;
    protected $checked;
    protected $disabled;
    protected $formaction;
    protected $formenctype;
    protected $formmethod;
    protected $form;
    protected $formnovalidate;
    protected $formtarget;
    protected $height;
    protected $label;
    protected $list;
    protected $maxlength;
    protected $max;
    protected $min;
    protected $multiple;
    protected $name;
    protected $pattern;
    protected $placeholder;
    protected $readonly;
    protected $required;
    protected $size;
    protected $src;
    protected $step;
    protected $text;
    protected $type;
    protected $value;

    public function __construct()
    {
        parent::__construct();
    }

    public function GenerateHtml()
    {
        $this->formHtml = $this->label;
        $this->formHtml .= "<input";
        $this->formHtml .= $this->alt;
        $this->formHtml .= $this->accept;
        $this->formHtml .= $this->autocomplete;
        $this->formHtml .= $this->autofocus;
        $this->formHtml .= $this->checked;
        $this->formHtml .= $this->disabled;
        $this->formHtml .= $this->form;
        $this->formHtml .= $this->formaction;
        $this->formHtml .= $this->formenctype;
        $this->formHtml .= $this->formmethod;
        $this->formHtml .= $this->formnovalidate;
        $this->formHtml .= $this->formtarget;
        $this->formHtml .= $this->height;
        $this->formHtml .= $this->list;
        $this->formHtml .= $this->max;
        $this->formHtml .= $this->maxlength;
        $this->formHtml .= $this->min;
        $this->formHtml .= $this->multiple;
        $this->formHtml .= $this->name;
        $this->formHtml .= $this->pattern;
        $this->formHtml .= $this->placeholder;
        $this->formHtml .= $this->readonly;
        $this->formHtml .= $this->required;
        $this->formHtml .= $this->size;
        $this->formHtml .= $this->src;
        $this->formHtml .= $this->step;
        $this->formHtml .= $this->value;
        $this->formHtml .= $this->type;
        $this->formHtml .= "/>";
        $this->formHtml .= $this->text;
    }

    public function SetAttribute($Attribute)
    {
        $this->Attribute = $Attribute;
    }

    public function SetAccept($accept)
    {
        $this->accept = $accept;
    }

    public function SetAlt($alt)
    {
        $this->alt = $alt;
    }

    public function SetAutocomplete($autocomplete)
    {
        $this->autocomplete = $autocomplete;
    }

    public function SetAutofocus($autofocus)
    {
        $this->autofocus = $autofocus;
    }

    public function SetDisabled($disabled)
    {
        $this->disabled = $disabled;
    }

    public function SetForm($form)
    {
        $this->form = $form;
    }

    public function SetFormaction($formaction)
    {
        $this->formaction = $formaction;
    }

    public function SetFormenctype($formenctype)
    {
        $this->formenctype = $formenctype;
    }

    public function SetFormmethod($formmethod)
    {
        $this->formmethod = $formmethod;
    }

    public function SetFormnovalidate($formnovalidate)
    {
        $this->formnovalidate = $formnovalidate;
    }

    public function SetFormtarget($formtarget)
    {
        $this->formtarget = $formtarget;
    }

    public function SetHeight($height)
    {
        $this->height = $height;
    }

    public function SetList($list)
    {
        $this->list = $list;
    }
    
    public function SetLabel($label)
    {
        $this->label = $label;
    }

    public function SetMax($max)
    {
        $this->max = $max;
    }

    public function SetMaxlength($maxlength)
    {
        $this->maxlength = $maxlength;
    }

    public function SetMin($min)
    {
        $this->min = $min;
    }

    public function SetMultiple($multiple)
    {
        $this->multiple = $multiple;
    }

    public function SetName($name)
    {
        $this->name = $name;
    }

    public function SetPattern($pattern)
    {
        $this->pattern = $pattern;
    }

    public function SetPlaceholder($placeholder)
    {
        $this->placeholder = $placeholder;
    }

    public function SetReadonly($readonly)
    {
        $this->readonly = $readonly;
    }

    public function SetRequired($required)
    {
        $this->required = $required;
    }

    public function SetSize($size)
    {
        $this->size = $size;
    }

    public function SetSrc($src)
    {
        $this->src = $src;
    }

    public function SetStep($step)
    {
        $this->step = $step;
    }

    protected function SetType($type)
    {
        $this->type = " type=".$type." ";
    }
    
    public function SetText($text)
    {
        $this->text = $text;
    }

    public function SetValue($value)
    {
        $this->value = $value;
    }
}
